{% extends 'base.html' %}

{% block title %}个性化学习路径{% endblock %}

{% block content %}
<div class="container py-4">
    <h1 class="mb-4">个性化学习路径</h1>
    
    <div class="row mb-4">
        <div class="col-md-12">
            <div class="card shadow-sm">
                <div class="card-header bg-primary text-white">
                    <h5 class="card-title mb-0">您的学习进度</h5>
                </div>
                <div class="card-body">
                    <div class="progress mb-3" style="height: 25px;">
                        {% set overall_progress = 65 %}  <!-- 这应该是一个计算值，这里使用示例值 -->
                        <div class="progress-bar bg-success" role="progressbar" style="width: {{ overall_progress }}%;" aria-valuenow="{{ overall_progress }}" aria-valuemin="0" aria-valuemax="100">{{ overall_progress }}%</div>
                    </div>
                    <p class="text-muted">继续按照您的学习路径前进，完成更多课程和练习以提高您的进度。</p>
                </div>
            </div>
        </div>
    </div>
    
    <div class="row">
        <div class="col-md-12">
            <h3 class="mb-3">推荐学习路径</h3>
            
            {% if learning_paths %}
                <div class="row">
                    {% for path in learning_paths %}
                        <div class="col-md-6 mb-4">
                            <div class="card h-100 shadow-sm {% if path.is_recommended %}border-primary{% endif %}">
                                {% if path.is_recommended %}
                                    <div class="card-header bg-primary text-white">
                                        <span class="badge bg-warning text-dark">教师推荐</span>
                                        <h5 class="card-title mb-0 mt-2">{{ path.title }}</h5>
                                    </div>
                                {% else %}
                                    <div class="card-header">
                                        <h5 class="card-title mb-0">{{ path.title }}</h5>
                                    </div>
                                {% endif %}
                                <div class="card-body">
                                    <p class="card-text">{{ path.description }}</p>
                                    
                                    <!-- 课程列表 -->
                                    <h6 class="mt-3 mb-2">包含课程:</h6>
                                    <ul class="list-group list-group-flush mb-3">
                                        {% for course in path.courses %}
                                            <li class="list-group-item px-0">
                                                <div class="d-flex justify-content-between align-items-center">
                                                    <span>{{ course.title }}</span>
                                                    {% set course_progress = 70 %}  <!-- 示例值 -->
                                                    <div class="progress" style="width: 100px;">
                                                        <div class="progress-bar bg-success" role="progressbar" style="width: {{ course_progress }}%;" aria-valuenow="{{ course_progress }}" aria-valuemin="0" aria-valuemax="100"></div>
                                                    </div>
                                                </div>
                                            </li>
                                        {% endfor %}
                                    </ul>
                                    
                                    <div class="d-grid gap-2">
                                        <a href="#" class="btn btn-primary">继续学习</a>
                                    </div>
                                </div>
                                <div class="card-footer text-muted">
                                    创建于: {{ path.created_at.strftime('%Y-%m-%d') }}
                                </div>
                            </div>
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <div class="alert alert-info">
                    <p>暂无学习路径。系统将根据您的兴趣和学习情况为您创建个性化学习路径。</p>
                </div>
            {% endif %}
        </div>
    </div>
    
    <!-- 兴趣选择 -->
    <div class="row mt-4">
        <div class="col-md-12">
            <div class="card shadow-sm">
                <div class="card-header">
                    <h5 class="card-title mb-0">更新您的学习兴趣</h5>
                </div>
                <div class="card-body">
                    <form action="#" method="post">
                        <div class="mb-3">
                            <label class="form-label">选择您感兴趣的学科领域（可多选）</label>
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest1" name="interests[]" value="math">
                                        <label class="form-check-label" for="interest1">数学</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest2" name="interests[]" value="physics">
                                        <label class="form-check-label" for="interest2">物理</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest3" name="interests[]" value="chemistry">
                                        <label class="form-check-label" for="interest3">化学</label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest4" name="interests[]" value="biology">
                                        <label class="form-check-label" for="interest4">生物</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest5" name="interests[]" value="history">
                                        <label class="form-check-label" for="interest5">历史</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest6" name="interests[]" value="geography">
                                        <label class="form-check-label" for="interest6">地理</label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest7" name="interests[]" value="english">
                                        <label class="form-check-label" for="interest7">英语</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest8" name="interests[]" value="chinese">
                                        <label class="form-check-label" for="interest8">语文</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="interest9" name="interests[]" value="programming">
                                        <label class="form-check-label" for="interest9">编程</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                            <button type="submit" class="btn btn-primary">更新兴趣</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 